<?php
namespace Api\Application;

/**
 * Class Benchmark
 * @package Api\Application
 * @author Steffen Brem <steffenbrem@gmail.com>
 */
class Benchmark
{
    static protected $time;

    /**
     *
     */
    static public function start()
    {
        self::$time = microtime(true);
    }

    /**
     * @return float
     */
    static public function time()
    {
        return round((microtime(true) - self::$time) * 1000, 2);
    }

    static public function log($message = '')
    {
        error_log('Time: ' . self::time() . ' - ' . $message);
    }
}